import 'package:flutter/material.dart';
import 'package:flutter_common/ui/widget/expansion_tile.dart';
import 'package:flutter_common/ui/widget/skeleton.dart';
import 'package:flutter_common/ui/widget/text.dart';
import 'package:flutter_common/util/toast_util.dart';

class ExpansionTileDemo extends StatelessWidget with LoadingDataSkeleton<int> {
  const ExpansionTileDemo({super.key});


  Future<int> _dd() {
    return Future.delayed(const Duration(seconds: 1)).then((value) => 1);
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: const Text("text demo"),
        ),
        body: FutureBuilder(future: _dd(), initialData: 0,builder: loadingData));
  }

  @override
  Widget doneWidget(BuildContext context, data) {
    return SingleChildScrollView(
        child: Column(
          children: const [
            FxExpansionTile(title: Text('data'), children: [
              Text('123'),
              Text('123'),
              Text('123'),
              Text('123'),
            ],),

            FxExpansionTile(title: Text('data'),
              trailing: FxCheckBox(
                value: true,
                fontSize: 0,
              ),
              trailingRotate: false,
              children: [
                Text('123'),
                Text('123'),
                Text('123'),
                Text('123'),
              ],)
          ],
        ));
  }

}
